package designpattern.strategy.order;

import designpattern.strategy.order.domain.Coupon;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 刘牌
 * @Date: 2021/12/21/13:03
 * @Description:
 */
public class CouponDiscountStrategy implements IOrderDiscountStrategy<Coupon>{

    @Override
    public BigDecimal discount(Coupon coupon , BigDecimal totalMoney) {
        return totalMoney.subtract(coupon.getMoney());
    }
}
